package com.topisv.tms.repository.stock.instorageNew;

import java.util.List;

import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;

import com.topisv.tms.entity.stock.instorage.InstorageBill;

public interface InstorageBillNewDao extends PagingAndSortingRepository<InstorageBill, Long>, JpaSpecificationExecutor<InstorageBill> {
	@Query("select t from InstorageBill t where t.billCode=?")
	InstorageBill loadBillByCode(String billCode);
	
	@Modifying
	@Query("update InstorageBill t set t.newstatus=?2 where t.billCode=?1")
	void updateNewStatus(String billCode, String status);
	@Modifying
	@Query("update InstorageBill t set t.status=?2 where t.billCode=?1")
	void updateStatus(String billCode,String status);
	@Query("select t from InstorageBill t  where t.newstatus in('1','2','3') and status in('-1','0')")
	List<InstorageBill> findAPPInstorageBill();

}
